﻿<?php
require_once "config.php";
require_once "dbconfig.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>你比我胖</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="<?php echo $_ENV['webUrl']?>/css/boohee_17.css" rel="stylesheet" />
<style>
.recommend-md{
    width:518px;
    height:auto;
	margin:30px auto 10px auto;
	background:url(<?php echo $_ENV['imgUrl'] ?>/recommend-md_m1.gif) repeat-y center top;
}

.recommend-bt{
    height:auto;
	background:url(<?php echo $_ENV['imgUrl'] ?>/recommend-bt_m1.gif) no-repeat center bottom;
}

.recommend-tp{
    padding:25px;
    height:auto;
	background:url(<?php echo $_ENV['imgUrl'] ?>/recommend-tp_m1.gif) no-repeat center top;
}

.recommend-tp h1{
    font-size:14px;
	font-weight:bold;
	height:25px;
	margin-bottom:10px;
}

.recommend-tp p{
    line-height:25px;
    margin:10px 0;
}

.main-txra{
    padding:5px;
	border:1px solid #F7B;
	line-height:19px;
}

.main-txra p{
    text-indent:2em;
	line-height:25px;
	margin:0;
}

.main-btn{
	width:80px;
	height:25px;
	border:none;
	padding-top:3px;
	font-weight:bold;
	font-size:12px;
	color:#FFF;
	cursor:pointer;
	background:url(<?php echo $_ENV['imgUrl'] ?>/main-btn.gif) no-repeat center top;
}
</style>
</head>
<body>
<?php
$shareId;$outId;
if($_POST['method'] && $_POST['method'] == "update"){
   $shareId = $_POST['shareId'];
   $userName = $_GET['userName'];
   $outId = $_GET['outId'];
   $sqlQuery = "update app_pp_share_health set agree_num = agree_num + 1 where share_id=".$shareId." and status='1'";
   mysql_db_query($database, $sqlQuery);
}else{
	$shareId = $_GET['shareId'];
	$userName = $_GET['userName'];
	$outId = $_GET['outId'];
    $sqlQuery = "update app_pp_share_health set read_num = read_num + 1 where share_id=".$shareId." and status='1'";
	mysql_db_query($database, $sqlQuery);
}
$sqlQuery = "select * from app_pp_share_health where share_id=".$shareId." and status='1'";
$result = mysql_db_query($database, $sqlQuery);
$row = mysql_fetch_object($result);
?>
<div class="recommend-md">
  <div class="recommend-bt">
    <div class="recommend-tp">
       <h1 style="font-size:14px;font-weight:bold;height:25px;margin-bottom:10px;color:#F3A;"><?php echo $row->user_name;?>的瘦身计划</h1>
	  <h1>饮食计划：</h1>
	  <p class="main-point">
	     早餐：<?php echo $row->diet_plan_morning;?><br/>
		 中餐：<?php echo $row->diet_plan_noon;?><br/>
		 晚餐：<?php echo $row->diet_plan_night;?>
	  </p>
      <h1>运动计划：</h1>
	   <p class="main-point">
	     <?php echo $row->sports_plan;?>
	   </p>
	  <h1>附加说明：</h1> 
	     <p class="main-point">
		 <?php echo $row->memo;?></p>
	</div>	
  </div>
</div>
<form action="shareDetail.php"  method="post">
<input type="hidden" name="shareId" value="<?php echo $shareId;?>"/>
<input type="hidden" name="userName" value="<?php echo $shareId;?>"/>
<input type="hidden" name="outId" value="<?php echo $outId;?>"/>
<input type="hidden" name="method" value="update"/>
<p class="main-ct">
 <?php 
   if(!$_POST['method'] && $row->out_id != $outId){ ?>
  <input type='submit' class="main-btn" value='同意观点'>&nbsp;&nbsp;&nbsp;&nbsp;
 <?php } ?>
  <input type='button' class="main-btn" value='关闭' onClick='window.close();'></p>
</form>
</body>
<?php
	mysql_close();
?>	